$(document).ready(function(){
	$('#add_domain').submit(function() {
		var queryString = $('#add_domain').formSerialize();
		$.post('/domain/manage_add', queryString, function(data){
					if (data.r == 'succ') {
						alert('操作成功');
						window.location.reload();
					} else {
						alert('操作失败' +  "\n>" +  data.msg.join("\n>"));
					}
				}, 'json');
		return false;
	});

	$('table.del li a').click(function() {
		if (confirm('确定删除?')) {
			$.post('/domain/manage_del', {'domain_id': $(this).attr('domain_id')}, function(data){
					if (data.r == 'succ') {
						alert('操作成功');
						window.location.reload();
					} else {
						alert('操作失败' +  "\n>" +  data.msg.join("\n>"));
					}
				}, 'json');
		}
	});
});
